import Vue from 'vue'
import VueRouter from 'vue-router'

import Detail from '@/views/detail.vue'
import Layout from '@/views/layout.vue'
import Like from '@/views/second/like'
import Article from '@/views/second/article'
import Collect from '@/views/second/collect'
import User from '@/views/second/user'

import Login from '@/views/login.vue'
import Register from '@/views/register.vue'
import ListsOfCities from '@/views/ListsOfCities.vue'
import RentalHousing from '@/views/RentalHousing.vue'
import RoomDetails from '@/views/RoomDetails.vue'
import CollectionHouse from '@/views/CollectionHouse.vue'
import Mapindex from '@/views/Mapindex.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: 'like',
          component: Like
        },
        {
          path: 'article',
          component: Article
        },
        {
          path: 'collect',
          component: Collect
        },
        {
          path: 'user',
          component: User
        }
      ]
    },
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    },
    // 城市列表
    {
      path: '/listsofcities',
      component: ListsOfCities
    },
    // 我的出租
    {
      path: '/rentalhousing',
      component: RentalHousing
    },
    // 房间详情
    {
      path: '/RoomDetails',
      component: RoomDetails
    },
    // 我的收藏
    {
      path: '/CollectionHouse',
      component: CollectionHouse
    },
    // 地图
    {
      path: '/Mapindex',
      component: Mapindex
    }
  ]
})

export default router
